package com.magenta.maxoptra.gis;

import javax.jms.JMSException;

/*
* Project: MaxOptRA v1.1
* User: Ivan Usalko
* Date: 19.01.2009 13:39:24
*
* Copyright (c) 1999-2009 Magenta Corporation Ltd. All Rights Reserved.
* Magenta Technology proprietary and confidential.
* Use is subject to license terms.
*/
/**
 * The <code>GeoInfoProvider</code> interface provides access to the
 * geo information for scheduler.
 *
 * Interface has two basic mehods:
 *
 * <li> Method for requesting fastest route between sites. {@link #fastestRouteRequest}</li>
 * <li> Complete request indicator. {@link #isRequestComplete}</li>
 */
public interface GeoInfoProvider {
    /**
     * Synchronized part of protocol...
     *
     * If result is GeoInfo then request is cached.
     * If result is null then request is not cached.
     *
     * @param clientId scheduler instance.
     * @param fromSite route from Site.
     * @param toSite route to Site.
     * @return response.
     */
    @Deprecated
    ResponseGeoInfo incacheFastestRouteRequest(Long clientId, GeographicCoordinates fromSite, GeographicCoordinates toSite);

    /**
     * Async part of protocol...
     *
     * @param clientId for geo provider.
     * @param fromSite route from Site.
     * @param toSite route to Site.
     * @return Id of request.
     */
    ResponseGeoInfo fastestRouteRequest(Long clientId, GeographicCoordinates fromSite, GeographicCoordinates toSite) throws JMSException;

    /**
     * Async part of protocol...
     * @param requestId - request id returned by previous call of requests...
     * @return true if request completed.
     */
    boolean isRequestComplete(GeoInfoRequestId requestId);

//    /**
//     * Synchronized call - Request sites.
//     * @param clientId scheduler instance;
//     * @param keyword search keywords.
//     * @param optCount max option count.
//     * @return null if request not cached.
//     */
//    List<Site> incacheSitesRequest(Long clientId, String keyword, int optCount);

//    /**
//     * Async part of protocol...
//     * @param clientId scheduler instance;
//     * @param keyword search keywords.
//     * @param optCount max option count.
//     * @return id of request.
//     */
//    GeoInfoRequestId sitesRequest(Long clientId, String keyword, int optCount);
//
//    /**
//     * sync part of protocol...
//     * @return count request of provider and duration by request.
//     */
//    Counter getProfilingCounterProvider();
}